package com.glodon.paas.account.security.cas;

import org.jasig.cas.authentication.handler.AuthenticationException;
import org.jasig.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler;
import org.jasig.cas.authentication.principal.UsernamePasswordCredentials;

/**
 * Always authenticate successfully, since the previous authentication process already has checked the credentials.
 *
 * @author Don Li
 */
public class AlwaysTrueAuthenticationHandler extends AbstractUsernamePasswordAuthenticationHandler {
    @Override
    protected boolean authenticateUsernamePasswordInternal(UsernamePasswordCredentials credentials) throws AuthenticationException {
        log.debug("User [" + credentials.getUsername() + "] successfully authenticated");
        return true;
    }
}
